package com.hujf.yarn;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

import java.util.Arrays;

/**
 * @author Hujf
 * @title: WordCountJar
 * @date 2021/4/69:48
 * @description: TODO
 */
public class WordCountJar {

    private  static Tool tool;

    public static void main(String[] args) throws Exception {
        //创建配置
        Configuration conf = new Configuration();

        switch (args[0]){
            case "wordcount":
                tool = new WordCount();
                break;
            default:
                throw new RuntimeException("no such method");
        }
        //tool.setConf(conf);
        int run=ToolRunner.run(conf,tool, Arrays.copyOfRange(args,1,args.length));

        System.exit(run);

    }
}
